import spock.lang.Specification

/**
 * Created at 2017/10/11 11:58
 * @author gongweixin
 */
class SortExample extends Specification {

    def "test sort"() {
        def list = [1,3,2].sort().reverse()

        expect:
        list == [3,2,1]
        [1,3,2].reverse() == [2,3,1]
    }

    def "test set sort"() {
        expect:
        [1, 2, 3] == [2:1, 3:1, 1:1].keySet().sort()
    }
}
